package com.smart.seata.stock.controller;

import com.smart.seata.stock.service.StockService;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/stock")
public class StockController {
    @Resource
    StockService service;

    @PutMapping("/")
    boolean update(Long productId, Long quantity) {
        return service.decrStock(productId, quantity);
    }
}
